﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KillBill.Presentarion.Common.Printing.Reports
{
    public enum DataType
    {
        Text,
        Decimal,
    }
    public enum TextAlignment
    {
        Center,
        Left,
        Right
    }
    public class ColumnConfiguration
    {
        public string ColumnHeader { get; set; }
        public DataType ColumnDataType { get; set; }
        public int FieldLength { get; set; }
        public int DecimalPresition { get; set; }
        public TextAlignment Alignment { get; set; }

        /// <summary>
        /// Default text column (alignment left)
        /// </summary>
        public ColumnConfiguration(string columnHeader, int fieldLenght)
        {
            ColumnHeader = columnHeader;
            ColumnDataType = DataType.Text;
            FieldLength = fieldLenght;
            DecimalPresition = 0;
            Alignment = TextAlignment.Left;
        }

        /// <summary>
        /// Text Column
        /// </summary>
        public ColumnConfiguration(string columnHeader, TextAlignment alignment, int fieldLenght)
        {
            ColumnHeader = columnHeader;
            ColumnDataType = DataType.Text;
            Alignment = alignment;
            FieldLength = fieldLenght;
            DecimalPresition = 0;
        }
        /// <summary>
        /// Float or double column
        /// </summary>
        public ColumnConfiguration(string columnHeader, int fieldLenght, int decimalPresition)
        {
            ColumnHeader = columnHeader;
            ColumnDataType = DataType.Decimal;
            FieldLength = fieldLenght;
            DecimalPresition = decimalPresition;
            Alignment = TextAlignment.Right;
        }
    }
}
